/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package renderers;

import java.awt.Component;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JList;
import model.Module;

/**
 *
 * @author admin
 */
public class moduleComboBoxRenderer extends DefaultListCellRenderer
{

    @Override
    public Component getListCellRendererComponent(
            JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
    {
        super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
        if (value instanceof Module)
          {
            Module mec = (Module) value;
            setText(mec.getDescription());
          }
        return this;
    }
}
